<template>
  <div class="home">
    <button>登录</button> <button @click="register">注册</button>
    <div>{{msg}}</div>
  </div>
</template>

<script>

export default {
  name: 'Home',
  data() {
    return {
      msg: ''
    }
  },
  created() {
    this.$http('http://172.17.51.177:3000/login').then(res => {
      console.log(res)
    })
  },
  methods: {
    register() {
      this.$http('http://172.17.51.177:3000/register').then(res => {
        console.log(res)
        this.msg = res.data
      })
    }
  }
}
</script>
